/*
 *	Perlin Production Co. Ltd. September 2012 (c).
 *			WinGDI.h
 *		Port for Supersoft compiler
 */
 
#if !defined(_WINGDI)
#define _WINGDI

/*
	Names of structures are shortened since
	l80 only recognizes 6 symbols anyway:

	BF		BITMAPFILEHEADER
	BI		BITMAPINFOHEADER
	BC		BITMAPCOREHEADER
	BMCI		BITMAPCOREINFO
	RGBT		RGBTRIPLE
	RGB		RGBQUAD
	BMI		BITMAPINFO
*/


/* WinTypes.h */

#define	WORD	unsigned
#define	DWORD	unsigned long
#define LONG	long
#define	BYTE	char	/* not sure, if Supersoft supports unsigned char */


 
struct	_BF	/* BITMAPFILEHEADER */
{
        WORD    bfType;
        DWORD   bfSize;
        WORD    bfReserved1;
        WORD    bfReserved2;
        DWORD   bfOffBits;
};

#define BF struct _BF

#define BF_TYPE	0x4d42	/*BM signature */


/* biCompression */

#define	BI_RGB		0
#define	BI_RLE8		1
#define	BI_RLE4		2
#define	BI_BITFIELDS	3

struct	_BI	/*BITMAPINFOHEADER */
{
        DWORD      biSize;		/* 40 or more */
        LONG       biWidth;
        LONG       biHeight;
        WORD       biPlanes;		/* Must be 1 */
        WORD       biBitCount;		/* 1 4 8 16 24 */
        DWORD      biCompression;
        DWORD      biSizeImage;
        LONG       biXPelsPerMeter;
        LONG       biYPelsPerMeter;
        DWORD      biClrUsed;
        DWORD      biClrImportant;
};

#define BI struct _BI



struct	_BC			/*BITMAPCOREHEADER */
{
	DWORD   bcSize;		/* must be 12. Use to get to color table */
	WORD    bcWidth;
	WORD    bcHeight;
	WORD    bcPlanes;	/* Must be 1 */
	WORD    bcBitCount;	/* 1 4 8 24 */
};

#define BC struct _BC



struct _RGBT
{
	BYTE    rgbtBlue;
	BYTE    rgbtGreen;
	BYTE    rgbtRed;
};

#define RGBT struct _RGBT



struct	_BMCI			/*BITMAPCOREINFO*/
{
	BC  	bmciHeader;
	RGBT	bmciColors[1];
};


#define BMCI struct _BMCI



typedef struct _RGB		/* RGBQUAD */
{
        BYTE    rgbBlue;
        BYTE    rgbGreen;
        BYTE    rgbRed;
        BYTE    rgbReserved;
};

#define RGB struct _RGB



struct _BMI			/* BITMAPINFO */
{
	BI	bmiHeader;
	RGB	bmiColors[1];
};

#define BMI struct _BMI

#endif _WINGDI
